Simon Elsässer, Karolinska Institutet (2023)
bw_dir <- "/Volumes/DATA/DATA/Puck/bigwig/"
library("wigglescout")
library("ggpubr")
library("ggplot2")
library("DESeq2")
library("dplyr")
library("ggrastr")
clean <- function (fn) {
fn <- gsub(pattern = ".+/", "", x = fn)
fn <- gsub(pattern = ".mm9.+", "", x = fn)
fn <- gsub(pattern = ".mm39.+", "", x = fn)
fn <- gsub(pattern = "_S.+", "", x = fn)
fn <- gsub(pattern = "_combined.+", "", x = fn)
fn <- gsub(pattern = "G4 CnT ", "", x = fn)
fn <- gsub(pattern = "_batch2", "", x = fn)
fn <- gsub(pattern = "-", " ", x = fn)
fn <- gsub(pattern = "_", " ", x = fn)
fn <- gsub(pattern = " HA ", " ", x = fn)
fn <- gsub(pattern = "D1D6", "FANCJ-/-", x = fn)
fn <- gsub(pattern = "P2D2", "DHX36-/-", x = fn)
fn <- gsub(pattern = "P3D4", "FANCJ-/-DHX36-/-", x = fn)
return(fn)
}
BWs <- paste0(bw_dir,list.files(bw_dir,pattern="G4_.+_combined.bw"))
mypal <-c("cornflowerblue","orange","red2","#505050")
mypal3 <-c("cornflowerblue","cornflowerblue","cornflowerblue","orange","orange","orange","red2","red","red2","black","black","black")
mypal2 <-c("cornflowerblue","cornflowerblue","orange","orange","red2","red","black","black")
ggsave("plots/profile_G4_DHX36.pdf",plot_profile_G4_DHX36,width = 3, height= 3)
ggsave("plots/profile_G4_FANCJ.pdf",plot_profile_G4_FANCJ,width = 3, height= 3)
ggsave("plots/profile_G4_DKO.pdf",plot_profile_G4_DKO,width = 3, height= 3)
ggsave("plots/profile_G4_nonsig.pdf",plot_profile_G4_nonsig,width = 3, height= 3)
ggsave("plots/profile_G4_ProAct.pdf",plot_profile_G4_proact,width = 3, height= 3)
ggsave("plots/profile_G4_ProBiv.pdf",plot_profile_G4_probiv,width = 3, height= 3)
ggsave("plots/profile_G4_EnhAct.pdf",plot_profile_G4_enhact,width = 3, height= 3)
ggsave("panels/heatmap_G4.pdf",plot_heatmap_G4,width = 6, height= 3)
p <- ggdraw() +
draw_plot(plot_profile_G4_DHX36, x = 0, y = 0, width = .33, height = 1) +
draw_plot(plot_profile_G4_nonsig, x = .33, y = 0, width = .33, height = 1) +
draw_plot(plot_profile_G4_enhact, x = 0.66, y = 0, width = .33, height = 1)
p
ggsave("panels/profiles_G4_peak_enh.pdf",p,width=8, height=3)
p <- ggdraw() +
draw_plot(plot_heatmap_G4, x = .0, y = 0, width = .5, height = 1) +
draw_plot(plot_profile_G4_DHX36, x = .5, y = 0.5, width = .25, height = .5) +
draw_plot(plot_profile_G4_FANCJ, x = .5, y = 0, width = .25, height = .5) +
draw_plot(plot_profile_G4_DKO, x = .75, y = 0.5, width = .25, height = .5) +
draw_plot(plot_profile_G4_nonsig, x = 0.75, y = 0, width = .25, height = .5)
p
ggsave("panels/heatmap_G4_peaks.pdf",p,width=8, height=3)
p <- ggdraw() +
draw_plot(plot_heatmap_G4, x = .0, y = 0, width = .5, height = 1) +
draw_plot(plot_profile_G4_DKO, x = .5, y = 0.5, width = .25, height = .5) +
draw_plot(plot_profile_G4_nonsig, x = .5, y = 0, width = .25, height = .5) +
draw_plot(plot_profile_G4_proact, x = .75, y = 0.5, width = .25, height = .5) +
draw_plot(plot_profile_G4_enhact, x = 0.75, y = 0, width = .25, height = .5)
p
ggsave("panels/heatmap_G4_peaks_pro_enh.pdf",p,width=8, height=3)
ggsave("plots/profile_Rloop_DHX36.pdf",plot_profile_Rloop_DHX36,width = 3, height= 3)
ggsave("plots/profile_Rloop_FANCJ.pdf",plot_profile_Rloop_FANCJ,width = 3, height= 3)
ggsave("plots/profile_Rloop_DKO.pdf",plot_profile_Rloop_DKO,width = 3, height= 3)
ggsave("plots/profile_Rloop_nonsig.pdf",plot_profile_Rloop_nonsig,width = 3, height= 3)
p <- ggdraw() +
draw_plot(plot_heatmap_Rloop, x = .0, y = 0, width = .5, height = 1) +
draw_plot(plot_profile_Rloop_DHX36, x = .5, y = 0.5, width = .25, height = .5) +
draw_plot(plot_profile_Rloop_FANCJ, x = .5, y = 0, width = .25, height = .5) +
draw_plot(plot_profile_Rloop_DKO, x = .75, y = 0.5, width = .25, height = .5) +
draw_plot(plot_profile_Rloop_nonsig, x = 0.75, y = 0, width = .25, height = .5)
p
ggsave("panels/peak_Rloop_heatmap.pdf",p,width=8, height=3)
p <- ggdraw() +
draw_plot(plot_profile_Rloop_DHX36, x = 0, y = 0, width = .33, height = 1) +
draw_plot(plot_profile_Rloop_DKO, x = .33, y = 0, width = .33, height = 1) +
draw_plot(plot_profile_Rloop_nonsig, x = 0.66, y = 0, width = .33, height = 1)
p
ggsave("panels/peak_Rloop_profiles.pdf",p,width=8, height=3)
cov_proHi <- bw_loci(BWs, loci = "../genome/genes_hi_lt10kb.mm39.bed",labels = clean(BWs))
df <- as.data.frame(cov_proHi)[6:9]
colnames(df) <- c("FANCJ","DHX36","DKO","WT")
ggscatter(df,x ="WT",y="DKO",size = 0.8, alpha=0.5) + geom_abline(slope = 1, intercept = 0, linetype="dashed", size=0.1)
mdf <- melt(df)
ggviolin(mdf, x="variable",y="value",fill="variable",palette = mypal, add="mean_sd") +
coord_cartesian(ylim=c(0,15))